﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Automation.Peers;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Practices.Prism.Mvvm;

namespace AesonXamlControls.Interaction.AesonPopup
{
    /// <summary>
    /// Interaction logic for AesonChildWindows.xaml
    /// </summary>
    public partial class AesonChildWindows : IView
    {
        public AesonChildWindows()
        {
            InitializeComponent();
        }


        public IConfirmation Confirmation
        {
            get
            {
                return this.MyContent.DataContext as IConfirmation;
            }
            set
            {
                this.MyContent.DataContext = (object)value;
            }
        }

        private void OkButton_Click(object sender, RoutedEventArgs e)
        {
            Confirm(true);
        }

        public void Confirm(bool b)
        {
            this.Confirmation.Confirmed = b;
            this.Close();
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            Confirm(false);
        }
    }
}
